﻿@model LAPI.Data.Model.Deporte
           
<div class="row">
    <h2>Administración de Deportes</h2>
    <h3>Crea, Elimina o Actualiza los deportes o actividades en LAPI...</h3>
</div>
<hr />

<div class="row">
<div id="msg" class="span5"></div> 
</div>

<div class="marketing">
    <div class="row">
        @using (Ajax.BeginForm(
            actionName: "Crear",
            controllerName: "Deporte",
            routeValues: null,
            ajaxOptions: new AjaxOptions { HttpMethod = "Post" /*, InsertionMode = System.Web.Mvc.Ajax.InsertionMode.InsertBefore, UpdateTargetId = "alerts"*/, OnFailure = "PostFailure", OnSuccess = "PostSuccess", OnComplete = "PostOnComplete" },
            htmlAttributes: new Dictionary<string, object> { { "class", "form-horizontal" } }
        ))
        {          
             
             <div class="control-group">
                @LAPI.Web.Helpers.LabelExtensions.LabelFor(this.Html, m => m.descripcion, new Dictionary<string, object> { { "class", "control-label" } })
                <div class="controls">                   
                    @LAPI.Web.Helpers.TextBoxExtension.TextBoxFor(this.Html, m => m.descripcion, new Dictionary<string, object> { { "class", "span3" }, { "placeholder", "nombre del deporte..." } })
                </div>
            </div>
            
            <div class="control-group">
                @LAPI.Web.Helpers.LabelExtensions.LabelFor(this.Html, m => m.color, new Dictionary<string, object> { { "class", "control-label" } })
                <div class="controls">
                    <div class="input-append color" data-color="" data-color-format="hex">
                    @LAPI.Web.Helpers.TextBoxExtension.TextBoxFor(this.Html, m => m.color, new Dictionary<string, object> { { "class", "span3" }, { "maxlength", "7" }, { "placeholder", "color..." } })                   
                    <span class="add-on"><i id="colortest" style="background-color: White"></i></span>
                    </div>
                </div>
            </div>                                 

            <div class="control-group">
                <div class="controls">
                    <button type="submit" class="btn btn-success">
                        <i class="icon-ok"></i>
                        Crear</button>
                    <a class="btn btn-danger" href="@Url.Action(actionName: "Gestion", controllerName: "Deporte")">
                        <i class="icon-remove"></i>
                        Cancelar
                    </a> 
                </div> 
            </div>
        }                        
    </div>
</div>

@section Script {   
<script type="text/javascript">
    document.forms[0].descripcion.focus();

    $(function () {
        window.prettyPrint && prettyPrint()
        $('input#color').colorpicker().on('changeColor', function (ev) {
            $('i#colortest').css("background-color", ev.color.toHex());
        });
    });
	
</script>
}
